list_2 = [
    {
        "type": "城乡建设_城市建设和管理_城管执法",
        "type_score": 1,
        "keyword": [
            {
                "name": "残渣剩水",
                "level": 1.0
            },
            {
                "name": "臭气冲天",
                "level": 2.0
            },
            {
                "name": "占道经营",
                "level": 2.0
            }
        ]
    },
    {
        "type": "城乡建设_城市建设和管理_居民服务设施",
        "type_score": 3,
        "keyword": [
            {
                "name": "安全隐患",
                "level": 3.0
            },
            {
                "name": "拆迁",
                "level": 3.0
            },
            {
                "name": "拆迁补偿",
                "level": 3.0
            },
            {
                "name": "电梯经常出故障",
                "level": 2.0
            }
        ]
    }
]
res = 0
for en in list_2:
    res = 0
    for j in en['keyword']:
        print("j['level']", j['level'], end=" ")
        res = j['level'] + res
        print(res)
    print(len(en['keyword']))
    res = res / len(en['keyword'])
    print(res)
